from sanic.response import json
from application import create_app
from application.config import config

# 初始化
app = create_app(config)

# 任务
# app.add_task()

# 默认路由
@app.route("/")
async def index(request):
    return json({'hi': 'sanic'})

if __name__ == '__main__':
    app.run(port=config['PORT'], debug=config['DEBUG'], access_log=False)